/*
 * Copyright (C), 2002-2012, 苏宁易购电子商务有限公司
 * FileName: ${model}ServiceImpl.java
 * Author:   ${author}
 * Date:     ${date}
 * Description:  //模块目的、功能描述      
 * History://修改记录
 * <author> <time>  <version>  <desc> 
 */
package ${serviceImplpackage};

import com.suning.framework.lang.GenericResult;
import com.suning.framework.lang.Result;
import ${daopackageClass};
import ${dmopackageClass};
import ${servicepackageClass};
import com.suning.plsadm.util.page.Limit;

import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 接口服务实现类<br>
 * 〈功能详细描述〉
 *
 * @author ${author}
 * @see [相关类/方法]（可选）
 * @since [产品/模块版本] （可选）
 */
@Service("${lowercasemodel}Service")
public class ${model}ServiceImpl implements ${model}Service {
    /**
     * ${model}Dao层服务
     */
    @Autowired
    ${model}Dao ${lowercasemodel}Dao;

    /*
     * (non-Javadoc)
     * @see ${servicepackageClassDesc}getById(java.lang.Long)
     */
    @Override
    public GenericResult<${model}Entity> getById(Long id) {
        GenericResult<${model}Entity> result = new GenericResult<${model}Entity>();
        result.setObject(${lowercasemodel}Dao.getById(id));
        return result;
    }

    /*
     * (non-Javadoc)
     * @see
     * ${servicepackageClassDesc}save${model}(${dmopackageClass})
     */
    @Override
    public Result save${model}(${model}Entity ${lowercasemodel}) {
        Result result = new Result();
        Boolean flag = ${lowercasemodel}Dao.save${model}(repayPlan);
        if (!flag) {
            result.fail("保存实体失败");
        }
        return result;
    }

    /*
     * (non-Javadoc)
     * @see
     * ${servicepackageClassDesc}modify${model}(${dmopackageClass})
     */
    @Override
    public Result modify${model}(${model}Entity ${lowercasemodel}) {
        Result result = new Result();
        Boolean flag = ${lowercasemodel}Dao.modify${model}(repayPlan);
        if (!flag) {
            result.fail("保存实体失败");
        }
        return result;
    }

    /*
     * (non-Javadoc)
     * @see ${servicepackageClassDesc}remove${model}(java.lang.Long)
     */
    @Override
    public Result remove${model}(Long id) {
        Result result = new Result();
        Boolean flag = ${lowercasemodel}Dao.removeRepayPlan(id);
        if (!flag) {
            result.fail("保存实体失败");
        }
        return result;
    }

    /*
     * (non-Javadoc)
     * @see ${servicepackageClassDesc}queryAll(java.util.Map)
     */
    @Override
    public GenericResult<List<${model}Entity>> queryAll(Map<String, Object> condition) {
        GenericResult<List<${model}Entity>> result = new GenericResult<List<${model}Entity>>();
        result.setObject(${lowercasemodel}Dao.queryAll(condition));
        return result;
    }

    /*
     * (non-Javadoc)
     * @see ${servicepackageClassDesc}query${model}ByPage(java.util.Map,
     * com.suning.plsadm.util.page.Limit)
     */
    @Override
    public GenericResult<List<${model}Entity>> query${model}ByPage(Map<String,Object> condition, Limit limit){
        GenericResult<List<${model}Entity>> result = new GenericResult<List<${model}Entity>>();
        result.setObject(${lowercasemodel}Dao.query${model}ByPage(condition, limit));
        return result;
    }

}
